package com.zhoutao123.hephaestus.object.bussiness;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.zhoutao123.hephaestus.repository.entity.BlogComment;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;

@Data
@Accessors(chain = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class VBlogComment implements Serializable {

    private String id;

    private VBlog blog;

    private String nickname;

    private String email;

    private String url;

    private String content;

    private String blogId;

    public static VBlogComment of(BlogComment comment) {
        VBlogComment vBlogComment = new VBlogComment();
        return vBlogComment
                .setId(comment.getId())
                .setBlogId(comment.getBlogId())
                .setNickname(comment.getNickname())
                .setEmail(comment.getEmail())
                .setUrl(comment.getUrl())
                .setContent(comment.getContent());
    }
}
